import { Request, Response } from "express";
import { get, Controller, middleware } from "../decorator";
import { isValidUser, secondMiddleware } from "../middleware/middlewareFunc";

@Controller("/")
class FoodController {
  @get("/showFood/:foodname/:address")
  @middleware(secondMiddleware)
  @middleware(isValidUser)
  showFood(req: Request, res: Response) {
    console.log(req.params);
    res.setHeader("Content-Type", "text/html; charset=utf-8");
    res.write("狗不理包子");
    res.write("铁锅炖大鹅");
    res.end();
  }
}
